# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponent do
  @moduledoc """
  Message describing the system component.

  ## Attributes

  *   `applicationProperties` (*type:* `GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentApplicationProperties.t`, *default:* `nil`) - Optional. The component is a SAP application.
  *   `databaseProperties` (*type:* `GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentDatabaseProperties.t`, *default:* `nil`) - Optional. The component is a SAP database.
  *   `haHosts` (*type:* `list(String.t)`, *default:* `nil`) - Optional. A list of host URIs that are part of the HA configuration if present. An empty list indicates the component is not configured for HA.
  *   `hostProject` (*type:* `String.t`, *default:* `nil`) - Required. Pantheon Project in which the resources reside.
  *   `region` (*type:* `String.t`, *default:* `nil`) - Optional. The region this component's resources are primarily located in.
  *   `replicationSites` (*type:* `list(GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentReplicationSite.t)`, *default:* `nil`) - Optional. A list of replication sites used in Disaster Recovery (DR) configurations.
  *   `resources` (*type:* `list(GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource.t)`, *default:* `nil`) - Optional. The resources in a component.
  *   `sid` (*type:* `String.t`, *default:* `nil`) - Optional. The SAP identifier, used by the SAP software and helps differentiate systems for customers.
  *   `topologyType` (*type:* `String.t`, *default:* `nil`) - Optional. The detected topology of the component.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :applicationProperties =>
            GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentApplicationProperties.t()
            | nil,
          :databaseProperties =>
            GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentDatabaseProperties.t() | nil,
          :haHosts => list(String.t()) | nil,
          :hostProject => String.t() | nil,
          :region => String.t() | nil,
          :replicationSites =>
            list(GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentReplicationSite.t())
            | nil,
          :resources => list(GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource.t()) | nil,
          :sid => String.t() | nil,
          :topologyType => String.t() | nil
        }

  field(:applicationProperties,
    as: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentApplicationProperties
  )

  field(:databaseProperties,
    as: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentDatabaseProperties
  )

  field(:haHosts, type: :list)
  field(:hostProject)
  field(:region)

  field(:replicationSites,
    as: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponentReplicationSite,
    type: :list
  )

  field(:resources, as: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource, type: :list)
  field(:sid)
  field(:topologyType)
end

defimpl Poison.Decoder, for: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponent do
  def decode(value, options) do
    GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryComponent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
